﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Happy.Query;

namespace Happy.Web.Mvc.Paging
{
    /// <summary>
    /// 扩展类型。
    /// </summary>
    public static class PageResultExtentions
    {
        /// <summary>
        /// 转变为分页栏视图。
        /// </summary>
        public static PageBarView ToPageBarView<T>(this PageResult<T> that, long pageNumberLength)
        {
            return new PageBarView(pageNumberLength, that.ItemsPerPage, that.TotalItems, that.TotalPages, that.CurrentPage);
        }
    }
}
